home *** CD-ROM | disk | FTP | other *** search
- #include <dos.h>
- #include <tomlib.h>
-
- int far_read (int handle,char far *buffer,int count)
- {
- union REGS ir;
- struct SREGS sr;
-
- ir.h.ah = 0x3f;
- ir.x.bx = handle;
- ir.x.cx = count;
- ir.x.dx = FP_OFF(buffer);
- sr.ds = FP_SEG(buffer);
-
- intdosx (&ir, &ir, &sr);
- if (ir.x.cflag)
- return -1;
- return ir.x.ax;
- }
-
- int far_write (int handle,char far *buffer,int count)
- {
- union REGS ir;
- struct SREGS sr;
-
- ir.h.ah = 0x40;
- ir.x.bx = handle;
- ir.x.cx = count;
- ir.x.dx = FP_OFF(buffer);
- sr.ds = FP_SEG(buffer);
-
- intdosx (&ir, &ir, &sr);
- if (ir.x.cflag)
- return -1;
- return ir.x.ax;
- }
-
-